package jy.game.components.wuxue;


import jy.game.BasePojo;
import jy.game.components.resource.JyResource;
import jy.game.tools.JyResourceManager;
import wx.xml.simpleframework.xml.Attribute;
import wx.xml.simpleframework.xml.Root;

@Root(name = "trigger")
public class JyTrigger extends BasePojo {
    @Attribute(name = "name") public  String name;
    @Attribute(name = "argvs") public String argvsValue;
    @Attribute(name = "lv") public    int    level = -1;

    // (get) Token: 0x0600056E RID: 1390 RVA: 0x00033340 File Offset: 0x00031540
    @Override
    public /*override*/ String getPK() {
        String str = this.name + "_" + this.argvsValue;
        return str + "_" + this.level;
    }

    // (get) Token: 0x0600056F RID: 1391 RVA: 0x00004F51 File Offset: 0x00003151
    // [XmlIgnore]
    public String[] Argvs() {
        return (this.argvsValue.split(","));
    }

    public /*override*/ String ToString() {
        if (this.name.equals("AddBuff")) {
            return "";
        }
        if (this.name.equals("talent")) {
            String     text     = this.Argvs()[0];
            JyResource resource = JyResourceManager.get(JyResource.class, "天赋." + text);
            return String.format("天赋 %s(被动生效)\n%s", text, resource.value.split("#")[1]);
        }
        if (this.name.equals("eq_talent")) {
            String     text2    = this.Argvs()[0];
            JyResource resource = JyResourceManager.get(JyResource.class, "天赋." + text2);
            return String.format("天赋 %s(装备生效)\n%s", text2, resource.value.split("#")[1]);
        }
        JyResource resource = JyResourceManager.get(JyResource.class, "ItemTrigger." + this.name);
        String     value    = resource.value;
        return String.format(value, this.Argvs().toString());
    }
}